<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>门诊预约</title>
	<%@ include file="/common/meta.jsp" %>
	<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet"/>
	<script src="${ctx}/js/table.js" type="text/javascript"></script>
	<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
	<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
	<script src="${ctx}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script>
		$(document).ready(function() {

			var type = ${session.current_person.type};
			if(type == 0 || type == 3){
				$("#patientID").attr("readonly","readonly");//attr("disabled",true);//
			}else{
				
				$("#patientID").removeAttr("readonly");
			}
			
			//聚焦第一个输入框
		//	$("#patientID").focus();
			//为inputForm注册validate函数
			$("#mainForm").validate({
				rules: {
					patientID: "required",
					scheduled: "required",
					symptom: "required"
				}
			});
		});
	</script>
</head>
<body>
<div style="font-family:Arial;font-size:15px;font-weight:bold;font-style:normal;align:left">当前位置：校园诊所--门诊预约</div>
<s:form id="mainForm" action="appoint!save.action" method = "post">
<div id="message"><s:actionmessage theme="mytheme" cssClass="error" /></div>
<input type="hidden" name="id" value="${entity.id}"/>
<s:if test="%{apptNo != null}">
<script type="text/javascript">
	alert("您的预约号是 : ${apptNo}， 请在 <s:date name='scheduledDate' format='yyyy-MM-dd'/>  赴预，过期不候，谢谢！");
</script>
</s:if>
<table width="60%" class="noborder">
	<tr>
	<td>学号/工号：</td>
	<td><input type="text" name="patientID" size="35" id="patientID" value="${session.current_person.idNumber}" /></td>
	</tr>
	<tr>
	<td>预约日期：</td>
	<td><input type="text" id="scheduledDate" name="scheduledDate" size="35" readonly="readonly" 
			value="<s:date name='scheduledDate' format='yyyy-MM-dd'/>" 
			onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-%d'})"/></td>
	</tr>
	<tr>
	<td>症状描述：</td>
	<td><s:textarea id="symptom" name="symptom" theme="simple" cols="35" rows="4" /></td>
	</tr>
	<tr>
	<td>备注：</td>
	<td><s:textarea id="comments" name="comments" theme="simple" cols="35" rows="4"/></td>
	</tr>
	<tr>
		<td><s:submit type="button" theme="simple">开始预约</s:submit></td>
		<td></td>
	</tr>
</table>
</s:form>
</body>
</html>